﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IBLL;

namespace MisBLL
{
    public class ShopDAO : MarshalByRefObject, IShop
    {
        protected MisEntity.DataEntityDataContext Ctx = new MisEntity.DataEntityDataContext();

        public MisEntity.Shop GetId(string shopId)
        {
            var query = from a in Ctx.Shop where a.SHOP_ID==shopId
                        select a;
            if (query.Count<MisEntity.Shop>() == 0)
                return null;
            return query.First<MisEntity.Shop>();
        }

        public IList<MisEntity.Shop> GetAll()
        {
            var query = from item in Ctx.Shop
                        select item;
            if (query.Count<MisEntity.Shop>() == 0)
                return null;
            return query.ToList<MisEntity.Shop>();
        }

        public void Create(MisEntity.Shop entity)
        {
            throw new NotImplementedException();
        }

        public MisEntity.Shop Load(string Id)
        {
            throw new NotImplementedException();
        }

        public void Update(MisEntity.Shop entity)
        {
            throw new NotImplementedException();
        }

        public void Delete(string Id)
        {
            throw new NotImplementedException();
        }

        public void Delete(MisEntity.Shop entity)
        {
            throw new NotImplementedException();
        }
    }
}
